// type LengthOfString<T extends string> = T extends string ? T : T;

// type L = LengthOfString<"0000">;

// 把 "12345" 转成 ["1", "2", "3", "4", "5"] 然后再 .legnth 就可以计算长度了

type LengthOfString<
  S extends string,
  T extends string[] = []
> = S extends `${infer F}${infer R}`
  ? LengthOfString<R, [...T, F]>
  : T["length"];

type LTest<T extends string> = T extends `${infer F}${infer R}` ? F : T;
// type L1 = LTest<"Hu">;
// type LengType<T extends string[]> = T["length"];
// type LT = LengType<["1", "3"]>;
